CC = gcc
CFLAGS = -Wall -Wextra -std=c99
SRCDIR = .
OBJDIR = ../RELEASE
TARGET = $(OBJDIR)/libdata_io.a

SOURCES = $(SRCDIR)/data_io.c
OBJECTS = $(OBJDIR)/data_io.o

.PHONY: all clean

all: $(TARGET)

$(TARGET): $(OBJECTS)
	ar rcs $@ $^
	@echo "ModuleC static library created: $@"

$(OBJECTS): $(SOURCES)
	@mkdir -p $(OBJDIR)  # 确保目录存在
	$(CC) $(CFLAGS) -I../Include -c $< -o $@  # 使用 $< 和 $@ 确保路径正确

clean:
	rm -f $(OBJDIR)/data_io.o $(TARGET)


.PHONY: shared
shared:
	@echo "This module only creates static library"